<template>
	<view class="page">
		<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" interval="5000"
			duration="500" v-if="shenhe=='1'">
			<swiper-item class="swiper-item">
				<img class="img" src="/static/img/1.jpg" alt="">
			</swiper-item>
			<swiper-item class="swiper-item">
				<img class="img" src="/static/img/2.jpg" alt="">
			</swiper-item>
			<swiper-item class="swiper-item">
				<img class="img" src="/static/img/3.jpeg" alt="">
			</swiper-item>
		</swiper>
		<view class="model" @click="tap3">
			<text class="label">在线预约</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		
		<view class="model" @click="tap4" v-if="shenhe=='1'">
			<text class="label">企业介绍</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="model" @click="tap5" v-if="shenhe=='1'">
			<text class="label">新闻列表</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="model" @click="tap6" v-if="shenhe=='1'">
			<text class="label">关于我们</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="title" v-if="shenhe=='1'">康奇服务</view>
		<view class="toast" v-if="shenhe=='1'">
						该公司承着专业、专注、深入的服务理念，为社会提供高效管理的服务，同时也有很好的线上服务，为大家提供一体化服务
		</view>
<!-- 		<view class="model" @click="tap1" v-if="shenhe=='1'">
			<text class="label">部门管理</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="model" @click="tap2" v-if="shenhe=='1'">
			<text class="label">员工管理</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="model" @click="tap3">
			<text class="label">在线预约</text>
			<text class="icondemo demo-you right-icon"></text>
		</view>
		<view class="model" @click="tap4" v-if="shenhe=='1'">
			<text class="label">预约记录</text>
			<text class="icondemo demo-you right-icon"></text>
		</view> -->
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgs:[
					'https://ms.ys-n.com/uploads/20220629/6d5ab005b6e9d9f09ba2e1d437519c85.jpg',
					"https://ms.ys-n.com/uploads/20220629/81e3b26f79e0e8fc04d254c8f2d0250b.jpg",
					"https://ms.ys-n.com/uploads/20220629/7c9e23457deb2041cbcb04eb3fb06b67.jpg",
				],
				shenhe:0
			}
		},
		onShareAppMessage (option) {
		    // option.from === 'button'
		    return {
		      title: '在线咨询  解读报告',
		      desc: '在线咨询  解读报告',
		      path: '', // ?后面的参数会在转发页面打开时传入onLoad方法
		      imageUrl: '/static/upload/share_img.jpg', // 支持本地或远程图片，默认是小程序 icon
		      templateId: 'diqxbt84f5567ab44l',
		      success () {
		        console.log('转发发布器已调起，并不意味着用户转发成功，微头条不提供这个时机的回调');
		      },
		      fail () {
		        console.log('转发发布器调起失败');
		      }
		    }
		  },
		onLoad() {
			let that = this;
			uni.request({
				url: 'https://ms.ys-n.com/api/index/getsite',
				method: 'POST',
				header:{
					'Content-Type' : 'application/json',
				},
				data: {},
				success: res => {
					console.log(res)
					that.shenhe= res.data.data.shenhe;
				},
				fail: () => {},
				complete: () => {}
			});
		
		},
		methods: {
			tap1() {
				uni.navigateTo({
					url:'../tree/index'
				})
			},
			tap2(){
				uni.navigateTo({
					url:'../publicSelect/userListRadio'
				})
			},
			tap3(){
				uni.navigateTo({
					// url:'../index/index'
					url:'../publicSelect/userListRadio'
				})
			},
			tap4(){
				uni.navigateTo({
					url:'/pages/company/company'
				})
			},
			tap5(){
				uni.navigateTo({
					url:'/pages/newslist/newslist'
				})
			},
			tap6(){
				uni.navigateTo({
					url:'/pages/aboutme/aboutme'
				})
			}
			
		}
	}
</script>

<style scoped lang="scss">
	.title{
		padding: 24rpx;
		font-size: 30rpx;
		font-weight: bold;
	}
	.toast{
		padding:0 24rpx;
		color: #666666;
		font-size: 26rpx;
		line-height: 40rpx;
	}
	.swiper{
		width: 750rpx;
		height: 376rpx;
		.swiper-item{
			width: 100%;
			height: 376rpx;
			.img{
				width: 750rpx;
				height: 376rpx;
				}
		}
	}
	.model {
		padding: 30rpx 40rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2px solid #EBEEF5;
	}

	.label {
		font-size: 28rpx;
	}

	.right-icon {
		font-size: 32rpx;
		color: #909399;
	}
</style>
